[USER (data scientist)]: Cool, now let's figure out the mean, median, and quartiles of the property ages. Please generate statistics (mean, median, first quartile, and third quartile) for property ages in the 'flemington_housing' dataframe and serialize them as pickle files.

[YOU (AI assistant)]: Alright, here's the code to calculate the mean, median, and quartiles of property ages in Flemington:  
'''
import pandas as pd 
import pickle  
  
# Load the dataset  
melbourne_housing = pd.read_csv("melb_data.csv") 

# Calculate the maximum date in the dataset  
max_date = pd.to_datetime(melbourne_housing['Date']).max().year      # Calculate the mean, median, and quartiles of property ages in Flemington   
flemington_housing['Age'] = max_date - flemington_housing['YearBuilt']   
property_ages = flemington_housing['Age']      # Calculate mean, median, first quartile, and third quartile   
mean_age = property_ages.mean()   
median_age = property_ages.median()   
first_quartile = property_ages.quantile(0.25)   
third_quartile = property_ages.quantile(0.75)  

print(mean_age) 

# save data
pickle.dump(mean_age, open("./pred_result/mean_age.pkl","wb"))

print(third_quartile) 

# save data
pickle.dump(third_quartile, open("./pred_result/third_quartile.pkl","wb"))

print(median_age) 

# save data
pickle.dump(median_age, open("./pred_result/median_age.pkl","wb"))

print(first_quartile) 

# save data
pickle.dump(first_quartile, open("./pred_result/first_quartile.pkl","wb"))
'''

[USER (data scientist)]: Wait, I think there's an issue with the date format in the dataset. It's different from the default format you used. Can you update the code to handle the correct date format? 
My template of code snippet is:

---BEGIN CODE TEMPLATE---

import pandas as pd   
import pickle 
  
# Load the dataset  
fastfood = pd.read_csv("fastfood.csv")  

# YOUR SOLUTION BEGIN:
<code1>
[GENERATE YOUR CODE]
</code1>
# YOUR SOLUTION END:

print(mean_age) 

# save data
pickle.dump(mean_age, open("./pred_result/mean_age.pkl","wb"))

print(third_quartile) 

# save data
pickle.dump(third_quartile, open("./pred_result/third_quartile.pkl","wb"))

print(median_age) 

# save data
pickle.dump(median_age, open("./pred_result/median_age.pkl","wb"))

print(first_quartile) 

# save data
pickle.dump(first_quartile, open("./pred_result/first_quartile.pkl","wb"))
---END CODE TEMPLATE---

[YOU (AI assistant)]:  Sure, let me correct the code to handle the date format properly: 

 